#!/usr/bin/perl
use strict;
use warnings;
use CGI ();

#use CGI::Carp qw(fatalsToBrowser);
use MIME::Lite ();
use Person;
use Storable qw(lock_store);

my $country = Country->new('name' => 'Australia');
$country->load();

my $p = Person->new('name' => 'Woei Shyang', 'family_name' => 'Siaw', 'birth_date' => '06/08/1981', 'gender' => 'M', 'birth_country_id' => $country->id);
$p->save();

$p->phones({'number' => '04025526642', 'type' => 'Mobile', 'country_id' => $country->id});
$p->save();

my @phones = $p->phones();
my $phone = shift @phones;

$p->emails({'address' => 'test'.time.'@woeishyang.com', 'type' => 'Home'});
$p->save();

$p->addresses({'address_1' => '181 Grote Street', 'city' => 'Adelaide', 'state' => 'SA', 'postcode' => '5000', 'country_id' => $country->id, 'phones' => $phone});
$p->save();
